﻿<UserControl x:Class="MediaBrowser.CustomControls.ScrollControl.ScrollerControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MediaBrowser.CustomControls.ScrollControl"
    xmlns:CustomControls="clr-namespace:MediaBrowser.CustomControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	d:DesignWidth="768" d:DesignHeight="1024"
	Height="auto" Width="auto" BorderThickness="1">

    <UserControl.Resources>

        <!-- scroll viewer -->
        <Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}">
            <Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
            <Setter Property="VerticalScrollBarVisibility" Value="Hidden" />
        </Style>

        <!-- The main ItemsControl -->
        <Style x:Key="mainPanelStyle" TargetType="{x:Type ItemsControl}">
            <!--<Setter Property="Opacity" Value="0.25"/>
            <Style.Triggers>
                <Trigger Property="Control.IsMouseOver" Value="True">
                    <Setter Property="Opacity" Value="1.0"/>
                </Trigger>
            </Style.Triggers>-->
        </Style>

    </UserControl.Resources>
    <UserControl.BorderBrush>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="Black" Offset="0"/>
            <GradientStop Color="White" Offset="1"/>
        </LinearGradientBrush>
    </UserControl.BorderBrush>

    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#197A8696"/>
                <GradientStop Color="#197A8696" Offset="0.534"/>
                <GradientStop Color="#19778393" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>


        <local:FrictionScrollViewer Grid.Row="0" x:Name="ScrollViewer" Style="{StaticResource ScrollViewerStyle}" Friction="0.5" >
            <ItemsControl x:Name="itemsControl" Style="{StaticResource mainPanelStyle}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <local:ColumnedPanel IsItemsHost="True"
                                         Loaded="OnPanelLoaded"    
                                         Height="{Binding ElementName=ScrollViewer, Path=ActualHeight}"
                                         VerticalAlignment="Center">
                        </local:ColumnedPanel>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </local:FrictionScrollViewer>

        <local:ScrollButton Grid.Row="1" HorizontalAlignment="Center" Opacity="0.8" VerticalAlignment="Top" Height="35" Width="200"
                            OnValueChangeEvent="ScrollButton_OnValueChangeEvent"/>

        <!--<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0">            
            <CustomControls:ImageButton x:Name="zoomOut" Content="" Source="ZoomOut.png" Margin="0,0,5,0" Width="20" Height="20"
                                        Click="zoomOut_Click"/>
            <CustomControls:ImageButton x:Name="zoomFit" Content="" Source="ZoomFit.png" Margin="0,0,5,0" Width="20" Height="20"
                                        Click="zoomFit_Click"/>            
            <CustomControls:ImageButton x:Name="zoomIn" Content="" Source="ZoomIn.png" Margin="0,0,5,0" Width="20" Height="20"
                                        Click="zoomIn_Click"/>
        </StackPanel>-->

    </Grid>
</UserControl>
